function add0(m: any) {
  return m < 10 ? "0" + m : m;
}
export function dateTime(ts: any) {
  var time = new Date(ts);
  var year = time.getFullYear();
  var month = time.getMonth() + 1;
  var day = time.getDate();
  var hour = time.getHours();
  var minute = time.getMinutes();
  var second = time.getSeconds();

  return (
    year +
    "-" +
    add0(month) +
    "-" +
    add0(day) +
    " " +
    add0(hour) +
    ":" +
    add0(minute) +
    ":" +
    add0(second)
  );
}
